package com.pmcc.cj.entity;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.pmcc.core.entity.UUIDEntity;
import com.pmcc.utils.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 订单表
 * Created by tomas on 2020/9/5.
 */
@Entity
@Table(name = "cj_order")
public class CjOrder extends UUIDEntity {
    //订单类型  0：商城订单  1：飞防订单
    @Column(name = "genre")
    private Integer genre;
    @Column(name = "money")
    private BigDecimal money;//总金额
    @Column(name = "is_sale_rule")
    private Integer isSaleRule;//是否使用满减规则
    @Column(name = "is_yun")
    private Integer isYun;//是否需要飞防任务（只需要初始化，后续不改动，机手接单的逻辑走的是任务表的fettle_type字段）   0 不需要 1 需要
    @Column(name = "robot_id")
    private String robotId;//机手id
    @Column(name = "is_mail")
    private Integer isMail;//是否需要邮寄
    @Column(name = "address")
    private String address;//订单详细地址
    @Column(name = "linkman")
    private String linkman;//客户姓名
    @Column(name = "cellphone")
    private String cellphone;//手机号
    //订单状态  1:未完成    2：机手接单     3：已完成
    @Column(name = "order_status")
    private Integer orderStatus;
    @Column(name = "employee_id")
    private String employeeId;//用户id
    @Column(name = "retailer_id")
    private String retailerId;//零售商id
    @Column(name = "yun_name")
    private String yunName;//飞防套餐名称
    @Column(name = "yun_id")
    private String yunId;//飞防套餐id
    @Column(name = "commodity_count")
    private Integer commodityCount;//商品亩数
    @Column(name = "price")
    private BigDecimal price;//商品单价
    @Column(name = "order_index_id")
    private String orderIndexId;
    @Column(name = "is_normal")
    private Integer isNormal;//0标准，1非标准规格
    @Column(name = "create_time")
    private Date createTime;//创建时间
    @Column(name = "customer_confirm_time")
    private Date robotConfirmTime;//机手确认时间
    @Column(name = "robot_confirm")
    private Integer robotConfirm;//机手完成作业确认 0：未确认   1：确认
    //支付状态  0：未支付   1：已支付（待实施）   2:退单（成功）    3：取消    4：已完成（待评价和已评价）     5：无   6：退款申请中    7：退款失败
    @Column(name = "pay_status")
    private Integer payStatus;
    @Column(name = "customer_confirm")
    private Integer customerConfirm;//客户确认任务结束  0：未确认   1：确认
    @Column(name = "robot_confirm_time")
    private Date customerConfirmTime;//客户确认时间
    @Column(name = "customer_flag")
    private Integer customerFlag;//0：客户主动确认 1：系统根据时间确认
    @Column(name = "robot_thread",length = 2000)
    private String robotThread;//用于存放当前需要推送的机手id们，逗号分隔


    @Transient
    private String[] searches;
    @Transient
    private Integer flags;//用于查询退款的数据 flags=1

    public Integer getPayStatus() {
        return payStatus;
    }

    public void setPayStatus(Integer payStatus) {
        this.payStatus = payStatus;
    }

    public Integer getIsNormal() {
        return isNormal;
    }

    public void setIsNormal(Integer isNormal) {
        this.isNormal = isNormal;
    }

    public Integer getGenre() {
        return genre;
    }

    public void setGenre(Integer genre) {
        this.genre = genre;
    }

    public BigDecimal getMoney() {
        return money;
    }

    public void setMoney(BigDecimal money) {
        this.money = money;
    }

    public Integer getIsSaleRule() {
        return isSaleRule;
    }

    public void setIsSaleRule(Integer isSaleRule) {
        this.isSaleRule = isSaleRule;
    }

    public Integer getIsYun() {
        return isYun;
    }

    public void setIsYun(Integer isYun) {
        this.isYun = isYun;
    }

    public Integer getIsMail() {
        return isMail;
    }

    public void setIsMail(Integer isMail) {
        this.isMail = isMail;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getLinkman() {
        return linkman;
    }

    public void setLinkman(String linkman) {
        this.linkman = linkman;
    }

    public String getCellphone() {
        return cellphone;
    }

    public void setCellphone(String cellphone) {
        this.cellphone = cellphone;
    }

    public Integer getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(Integer orderStatus) {
        this.orderStatus = orderStatus;
    }

    public String getEmployeeId() {
        return employeeId;
    }

    public void setEmployeeId(String employeeId) {
        this.employeeId = employeeId;
    }

    public String getRetailerId() {
        return retailerId;
    }

    public void setRetailerId(String retailerId) {
        this.retailerId = retailerId;
    }

    public String getYunName() {
        return yunName;
    }

    public void setYunName(String yunName) {
        this.yunName = yunName;
    }

    public String getYunId() {
        return yunId;
    }

    public void setYunId(String yunId) {
        this.yunId = yunId;
    }

    public Integer getCommodityCount() {
        return commodityCount;
    }

    public void setCommodityCount(Integer commodityCount) {
        this.commodityCount = commodityCount;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public String getOrderIndexId() {
        return orderIndexId;
    }

    public void setOrderIndexId(String orderIndexId) {
        this.orderIndexId = orderIndexId;
    }
    @JsonSerialize(using = DateTimeFormat.class)
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    @JsonSerialize(using = DateTimeFormat.class)
    public Date getRobotConfirmTime() {
        return robotConfirmTime;
    }

    public void setRobotConfirmTime(Date robotConfirmTime) {
        this.robotConfirmTime = robotConfirmTime;
    }

    public Integer getRobotConfirm() {
        return robotConfirm;
    }

    public void setRobotConfirm(Integer robotConfirm) {
        this.robotConfirm = robotConfirm;
    }

    public String getRobotId() {
        return robotId;
    }

    public void setRobotId(String robotId) {
        this.robotId = robotId;
    }
    public Integer getCustomerConfirm() {
        return customerConfirm;
    }

    public void setCustomerConfirm(Integer customerConfirm) {
        this.customerConfirm = customerConfirm;
    }
    @JsonSerialize(using = DateTimeFormat.class)
    public Date getCustomerConfirmTime() {
        return customerConfirmTime;
    }

    public void setCustomerConfirmTime(Date customerConfirmTime) {
        this.customerConfirmTime = customerConfirmTime;
    }

    public Integer getCustomerFlag() {
        return customerFlag;
    }

    public void setCustomerFlag(Integer customerFlag) {
        this.customerFlag = customerFlag;
    }

    public String[] getSearches() {
        return searches;
    }

    public void setSearches(String[] searches) {
        this.searches = searches;
    }

    public Integer getFlags() {
        return flags;
    }

    public void setFlags(Integer flags) {
        this.flags = flags;
    }

    public String getRobotThread() {
        return robotThread;
    }

    public void setRobotThread(String robotThread) {
        this.robotThread = robotThread;
    }
}
